package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * sky-take-out
 * com.sky.mapper
 * OrderDetailMapper <br>
 *
 * @author Ablecisi
 * @version 1.0
 * 2025/4/12
 * 星期六
 * 21:49
 */
@Mapper
public interface OrderDetailMapper {

    /**
     * 批量插入订单明细
     *
     * @param orderDetailList 订单明细列表
     */
    void insertBatch(List<OrderDetail> orderDetailList);

    /**
     * 根据订单id查询订单明细
     *
     * @param orderId 订单id
     * @return 订单明细列表
     */
    @Select("select * from sky_take_out.order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);
}
